local jjj__huoji = fk.CreateSkill {

  name = "jjj__huoji&",

  tags = {  },

}



jjj__huoji:addEffect("viewas", {
  name = "jjj__huoji&",
  anim_type = "offensive",
  pattern = "fire_attack",
  prompt = "#huoji",
  card_filter = function(self, player, to_select, selected)
    return #selected == 0 and Fk:getCardById(to_select).color == Card.Red and Fk:currentRoom():getCardArea(to_select) ~= Player.Equip 
  end,
  view_as = function(self, player,cards)
    if #cards ~= 1 then return end
    local card = Fk:cloneCard("fire_attack")
    card.skillName = jjj__huoji.name
    card:addSubcard(cards[1])
    return card
  end,
  enabled_at_play = function(self, player)
    return not player:isKongcheng() and player:usedSkillTimes(jjj__huoji.name, Player.HistoryTurn) < 3
  end,
})

jjj__huoji:addEffect(fk.PreCardEffect, {
  name = "#jjj__huoji_trigger",
  events = {fk.PreCardEffect},
  mute = true,
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill("jjj__huoji&") and data.from == player.id and data.card.trueName == "fire_attack"
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    local card = data.card:clone()
    local c = table.simpleClone(data.card)
    for k, v in pairs(c) do
      card[k] = v
    end
    card.skill = jjj__huoji__fireAttackSkill
    data.card = card
  end,
})

return jjj__huoji